import apis from '@/apis/TodoList'
import { uaaApp } from '@/lib'

export enum ETodoTabTypes {
  // /* 入驻申请 */
  SETTLED_APPLICATION = 'SETTLED_APPLICATION',
  // /* 库存盘点 */
  // INVENTORY_CHECK = 'INVENTORY_CHECK',
  STOCKAPPROVAL = 'STOCKAPPROVAL',
  // /* 经销商库存盘点 */
  JXSSTOCKAPPROVAL = 'JXSSTOCKAPPROVAL',
  // /* 月度配额申请 */
  // MONTHLY_QUOTA_APPLICATION = 'MONTHLY_QUOTA_APPLICATION',
  QUOTASALEMAN = 'QUOTASALEMAN',
  // /* 月度配额下达 */
  // MONTHLY_QUOTA_RELEASE = 'MONTHLY_QUOTA_RELEASE',
  ORGAPPROVAL = 'ORGAPPROVAL',
  // /* 配额调整 */
  // QUOTA_ADJUSTMENT = 'QUOTA_ADJUSTMENT',
  QUOTAADJUST = 'QUOTAADJUST',
  // /* 配额转移 */
  // QUOTA_TRANSFER = 'QUOTA_TRANSFER',
  QUOTACHANGE = 'QUOTACHANGE',
  /* 问题货源处理 */
  PROBLEM_SOURCE_HANDLING = 'PROBLEM_SOURCE_HANDLING',
  /* 积分调整 */
  PRODUCT_ADJUSTMENT = 'PRODUCT_ADJUSTMENT',
  /* 积分考核结果 */
  POINTS_ASSESSMENT_RESULT = 'POINTS_ASSESSMENT_RESULT',
  //配额导入
  QUOTAIMPORT = 'QUOTAIMPORT',
  //冻结与解冻
  QUOTA_FREEZE = 'QUOTA_FREEZE',
  //等级权益导入
  USER_CUSTOMRANK_IMPORT = 'USER_CUSTOMRANK_IMPORT',
  //等级权益调整
  USER_CUSTOMRANK_ADJUST = 'USER_CUSTOMRANK_ADJUST',
  //运营资金
  WORKING_CAPITAL = 'WORKING_CAPITAL',
  //税前总利润
  GROSS_PROFIT = 'GROSS_PROFIT',
  //经营品项
  OPERATING_MAIN = 'OPERATING_MAIN ',
  //经销商待办
  AGENT_PROCESS = 'AGENT_PROCESS',
}

export const todoTabTypes: any = [
  // {
  //   title: "入驻申请",
  //   key: ETodoTabTypes.SETTLED_APPLICATION,
  //   hasAuth: uaaApp.canUse('register_backlog'),
  // }, // 隐藏入驻申请
  {
    title: '库存盘点',
    key: ETodoTabTypes.STOCKAPPROVAL,
    hasAuth: uaaApp.canUse('my_backlog_check_stock'),
  },
  {
    title: '经销商库存盘点',
    key: ETodoTabTypes.JXSSTOCKAPPROVAL,
    hasAuth: uaaApp.canUse('my_backlog_check_stock'),
  },
  //   {
  //     title: "月度配额申请",
  //     // key: ETodoTabTypes.MONTHLY_QUOTA_APPLICATION,
  //     key: ETodoTabTypes.QUOTASALEMAN,
  //     hasAuth: uaaApp.canUse('my_backlog_quota_mgmtworkflow'),
  //   },
  //   {
  //     title: "月度配额下达",
  //     // key: ETodoTabTypes.MONTHLY_QUOTA_RELEASE,
  //     key: ETodoTabTypes.ORGAPPROVAL,
  //     hasAuth: uaaApp.canUse('my_backlog_workfloworg'),
  //   },
  {
    title: '配额调整',
    // key: ETodoTabTypes.QUOTA_ADJUSTMENT,
    key: ETodoTabTypes.QUOTAADJUST,
    hasAuth: uaaApp.canUse('my_backlog_quota_quotamodifyworkflow'),
  },
  //   {
  //     title: "配额转移",
  //     // key: ETodoTabTypes.QUOTA_TRANSFER,
  //     key: ETodoTabTypes.QUOTACHANGE,
  //     hasAuth: uaaApp.canUse('my_backlog_quota_quotachangworkflow'),
  //   },
  {
    title: '配额导入',
    key: ETodoTabTypes.QUOTAIMPORT,
    hasAuth: uaaApp.canUse('my_backlog_quota_quotaimportworkflow'),
  },
  {
    title: '冻结解冻',
    key: ETodoTabTypes.QUOTA_FREEZE,
    hasAuth: uaaApp.canUse('my_backlog_quota_quotafreezeworkflow'),
  },
  // {
  //   title: '等级权益导入',
  //   key: ETodoTabTypes.USER_CUSTOMRANK_IMPORT,
  //   hasAuth: uaaApp.canUse('USER_CUSTOMRANK_IMPORT'),
  // },
  // {
  //   title: '等级权益调整',
  //   key: ETodoTabTypes.USER_CUSTOMRANK_ADJUST,
  //   hasAuth: uaaApp.canUse('USER_CUSTOMRANK_ADJUST'),
  // },
  {
    title: '运营资金',
    key: ETodoTabTypes.WORKING_CAPITAL,
    hasAuth: uaaApp.canUse('WORKING_CAPITAL'),
  },
  {
    title: '税前总利润',
    key: ETodoTabTypes.GROSS_PROFIT,
    hasAuth: uaaApp.canUse('GROSS_PROFIT'),
  },
  {
    title: '经营品项',
    key: ETodoTabTypes.OPERATING_MAIN,
    hasAuth: uaaApp.canUse('OPERATING_MAIN'),
  },
  {
    title: '问题货源处理',
    key: ETodoTabTypes.PROBLEM_SOURCE_HANDLING,
    disabled: true,
  },
  {
    title: '经销商待办',
    key: ETodoTabTypes.AGENT_PROCESS,
    hasAuth: uaaApp.canUse('AGENT_PROCESS'),
  },
]
